// pages/feedback/feedback.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    zishu: 0,
    neirong: null,
    upurl: [
      '../../image/qxtx/user/loadpic.png',
    ],
    witch: 0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  inputnow:function(e){
    var that = this;
    that.setData({
      zishu: e.detail.cursor,
      neirong: e.detail.value
    })
  },

  choose:function(e){
    var that = this;
    var n = parseInt(e.currentTarget.id);
    that.setData({
      witch: n
    })
  },

  loading:function(){
    var that = this;
    wx.chooseImage({
      count: 3,
      sizeType: ['original', 'compressed'],
      sourceType: ['album', 'camera'],
      success(res) {
        // tempFilePath可以作为img标签的src属性显示图片
        const tempFilePaths = res.tempFilePaths;
        that.setData({
          upurl: tempFilePaths
        })
      }
    })
  },
  
  ok:function(){
    var that = this;
    if (that.data.zishu == 0){
      wx.showToast({
        icon: 'none',
        title: '您还没有输入您的问题呢',
      })
    }else{
      wx.showToast({
        icon: 'success',
        title: '谢谢您的反馈',
      })
      setTimeout(function(){
        wx.switchTab({
          url: '../account/account',
        })
      },1000)
    }
  },
})